#[derive(Debug)]
struct Rectangle {
    w: u32,
    h: u32,
}

fn main() {
    let width = 30;
    let height = 50;
    println!(
        "The area of the rectangle is {} square pixels.",
        area(width, height)
    );

    let rect1 = (30, 50);
    println!(
        "The area of the rectangle is {} square pixels.",
        area1(rect1)
    );

    let rect2 = Rectangle {
        w:30,
        h:50,
    };
    println!(
        "The area of the rectangle is {} square pixels.",
        area2(&rect2)
    );

    println!("rect2 is {:?}", rect2);
}

fn area(width:u32, height:u32) -> u32 {
    return width * height;
}

fn area1(dimensions: (u32, u32)) -> u32{
    dimensions.0 * dimensions.1
}

fn area2(rectangle: &Rectangle) -> u32{
    rectangle.w * rectangle.h
}
